package com.sm.chatinputlibrary.emoji;

import androidx.annotation.Nullable;
import android.widget.ImageView;

import com.scorpio.baselibrary.adapter.BasicQuickAdapter;
import com.scorpio.baselibrary.adapter.BasicViewHolder;
import com.scorpio.baselibrary.utils.glide.GlideUtil;
import com.sm.chatinputlibrary.R;
import java.util.List;

/**
 * created by zhud on 2019/4/2
 */
public class EmojiLiseAdapter extends BasicQuickAdapter<EmojiBean, BasicViewHolder> {
    public EmojiLiseAdapter(@Nullable List<EmojiBean> data) {
        super(R.layout.input_item_emoji_image, data);
    }

    @Override
    protected void convert(BasicViewHolder helper, EmojiBean item) {
        helper.addOnClickListener(R.id.item_layout);
        if (item == null) {
            helper.setImageResource(R.id.emoji_image, R.drawable.input_face_delete_select);
        } else {
            GlideUtil.load(mContext, "file:///android_asset/" + item.getResourcePath(), (ImageView) helper.getView(R.id.emoji_image));
        }
    }
}
